package com.xwj.seckill.dao;

import com.xwj.seckill.domain.BookRob;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface BookRobMapper {
    int deleteByPrimaryKey(Long id);

    int insert(BookRob record);

    int insertSelective(BookRob record);

    BookRob selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(BookRob record);

    int updateByPrimaryKey(BookRob record);

    /**
     * 统计用户抢购到的书籍数量
     * 用于判断用户是否抢过该书籍
     * @param userId
     * @param bookNo
     * @return
     */
    int countByBookNoUserId(@Param("userId") Long userId, @Param("bookNo") String bookNo);

}